<script setup>
import { useRoute } from 'vue-router';
const route = useRoute();
</script>

<template>
  <div class="section4">
    <div class="tab-bar">
      <router-link to="/main/buy/viplevel">
        <button class="tab-button" :class="{ actived: route.path.includes('viplevel') }">
          {{ $t('pay1') }}
        </button>
      </router-link>
      <router-link to="/main/buy/gift">
        <button class="tab-button" :class="{ actived: route.path.includes('gift') }">
          {{ $t('pay2') }}
        </button>
      </router-link>
    </div>
    <div class="tab-content">
      <router-view></router-view>
    </div>
  </div>
</template>

<style scoped>
.section4 {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--wrap-bg);
}

.tab-bar {
  position: absolute;
  top: 2vw;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-button {
  font-weight: 700;
  padding: 10px 20px;
  margin: 0 10px;
  border: none;
  background-color: var(--bar-btn);
  color: var(--txcolor);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.tab-button.actived {
  background-color: #3498db;
  color: white;
}

.tab-content {
  width: 95%;
  height: calc(100% - 80px);
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 5px;
  position: fixed;
  right: 0;
  bottom: 0;
  background-color:var(--wrap-bg);
}
</style>